﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace NetFrame.EnDecode
{
    public class SeJson
    {
        public static string Serialization<T>(T message) {

            if (message == null) { return null; }
            return JsonConvert.SerializeObject(message);
        }

        public static T DeSerialization<T>(string value) {
            if (value == null || value.Equals(string.Empty)) { return default(T); }
            return JsonConvert.DeserializeObject<T>(value);
        }
    }
}
